﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.SessionState;
using TransFormer.BLL;

namespace TransFormer.Web.admin.AdminAshx
{
    /// <summary>
    /// ProductTypeRemove 的摘要说明
    /// </summary>
    public class ProductTypeRemove : IHttpHandler,IRequiresSessionState
    {
        private BLL.ProductType _bll = new ProductType();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var ids = context.Request["ids"];
            if (string.IsNullOrEmpty(ids)) return;
            if (Regex.IsMatch(ids, @"[^\d,]+")) return;
            if (_bll.DeleteList(ids))
                context.Response.Write("true");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}